package cn.ynrcb.personnelfile.common.utils;

import cn.hutool.crypto.SecureUtil;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class SignUtils {
    private static final String secretkey = "d0a540e0Aea06B5cd4C1f82D900fc8c5bab7"; // 密钥
    private static final String APP_ID = "HZTB_KMS_QUERY_20220217"; // 应用id

    public static Map<String,String> sign(){
        Map<String,String> params = new HashMap<>();
        //设置时间戳
        String timestamp = DateUtils.format(new Date(),DateUtils.DATE_TIME_PATTERN);
        //MD5加密
        String sign = SecureUtil.md5(secretkey + timestamp + APP_ID);
        //设置参数
        params.put("appId",APP_ID);
        params.put("timestamp",timestamp);
        params.put("sign",sign);

        return params;
    }

}
